:root {
    /* 颜色变量 */
    --primary-color: #4f46e5;
    --primary-light: #818cf8;
    --primary-dark: #3730a3;
    --background-light: #ffffff;
    --background-dark: #1a1a1a;
    --text-light: #374151;
    --text-dark: #f3f4f6;
    --border-light: #e5e7eb;
    --border-dark: #374151;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* 间距变量 */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* 圆角变量 */
    --border-radius-sm: 0.25rem;
    --border-radius-md: 0.5rem;
    --border-radius-lg: 1rem;
    --border-radius-full: 9999px;

    /* 阴影变量 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background-light);
    color: var(--text-light);
    line-height: 1.5;
    transition: background-color 0.3s, color 0.3s;
}

body.dark-theme {
    --background-light: var(--background-dark);
    --text-light: var(--text-dark);
    --border-light: var(--border-dark);
}

/* 布局容器 */
.app-container {
    display: grid;
    grid-template-columns: auto 1fr;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 240px;
    background-color: var(--background-light);
    border-right: 1px solid var(--border-light);
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-color);
    padding: var(--spacing-md);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-md);
    border: none;
    background: none;
    color: var(--text-light);
    cursor: pointer;
    transition: background-color 0.2s;
}

.nav-item:hover {
    background-color: var(--gray-100);
}

.nav-item.active {
    background-color: var(--primary-color);
    color: white;
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-around;
    padding: var(--spacing-md);
}

/* 主内容区样式 */
.main-content {
    padding: var(--spacing-xl);
    overflow-y: auto;
}

.panel {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.panel.active {
    display: block;
}

/* 任务面板样式 */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.task-filters {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.filter-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius-full);
    border: 1px solid var(--border-light);
    background: none;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.tasks-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.task-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: white;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
}

/* 计时器面板样式 */
.timer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xl);
}

.timer-circle {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    border: 8px solid var(--primary-light);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: white;
    box-shadow: var(--shadow-lg);
}

.timer-time {
    font-size: 3.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.timer-label {
    font-size: 1.2rem;
    color: var(--gray-500);
}

.timer-controls {
    display: flex;
    gap: var(--spacing-md);
}

.timer-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background-color: var(--primary-color);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.timer-btn:hover {
    transform: scale(1.1);
}

.timer-btn:disabled {
    background-color: var(--gray-300);
    cursor: not-allowed;
    transform: none;
}

/* 白噪音面板样式 */
.sounds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    padding: var(--spacing-md);
}

.sound-card {
    background-color: white;
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    cursor: pointer;
    transition: transform 0.2s;
}

.sound-card:hover {
    transform: translateY(-4px);
}

.sound-icon {
    font-size: 2rem;
    color: var(--primary-color);
    text-align: center;
}

.sound-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.volume-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    background: var(--gray-200);
    border-radius: var(--border-radius-full);
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

/* 迷你播放器样式 */
.mini-player {
    position: fixed;
    bottom: var(--spacing-md);
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    border-radius: var(--border-radius-full);
    padding: var(--spacing-sm) var(--spacing-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: var(--spacing-lg);
}

.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
}

/* 表单样式 */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    color: var(--gray-700);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: var(--spacing-sm);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-md);
    outline: none;
}

/* 按钮样式 */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-secondary {
    background-color: var(--gray-200);
    color: var(--gray-700);
    border: none;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: background-color 0.2s;
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: auto;
        flex-direction: row;
        justify-content: space-around;
        padding: var(--spacing-sm);
        z-index: 1000;
    }

    .logo,
    .sidebar-footer {
        display: none;
    }

    .nav-menu {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
    }

    .nav-item {
        flex-direction: column;
        padding: var(--spacing-sm);
    }

    .main-content {
        padding-bottom: 80px;
    }

    .timer-circle {
        width: 250px;
        height: 250px;
    }

    .sounds-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}
